﻿// This is an expendeble function on feb 07, 2010 by sanal
// This will make the parent TD also clickable which will load the menu link for non-IE browsers
// Remove if needed.
mb_enhancemenu_getAnchorNodeIDs(document.getElementById('ctl00_tbl_fb_hd'));
function mb_enhancemenu_getAnchorNodeIDs(fromParentNode)
{
    try
    {
        var anchorNodes = fromParentNode.getElementsByTagName("a");
        for (var i = 0; i < anchorNodes.length; i++) {
            if (anchorNodes[i].getAttribute('href')==null)
                continue;
            if (anchorNodes[i].innerHTML.indexOf('<')<0 && anchorNodes[i].getAttribute('href').indexOf('#')<0)
            {
                if (anchorNodes[i].parentNode.nodeName == "TD")//will be td in non-IE browsers
                {
                    anchorNodes[i].parentNode.style.cursor = "pointer";
                    anchorNodes[i].parentNode.onclick = function (evt) { 
                        try
                        {                            
                            mb_enhanceMenuNavigateWithReferrer(this.childNodes[0].getAttribute('href')); return false; 
                        }
                        catch(Excp){}
                    };
                }
            }
        }
    }
    catch(Exc_mnu_srch){}
}
function mb_enhanceMenuNavigateWithReferrer(url)//solves the referrer not set issue in IE
{
    try
    {
        var fakeLink = document.createElement ("a");
        if (typeof(fakeLink.click) == 'undefined' || typeof(fakeLink.click) == 'function')
        {
            document.location.href = url;  // sends referrer in FF, not in IE
        }
        else
        {
            fakeLink.href = url;
            document.body.appendChild(fakeLink);
            fakeLink.click();   // click() method defined in IE only
            //document.location.href = url;
        }
    }
    catch(Exc){
    }
}